package arbore;

import visitor.Visitor;

public class Nod {
	protected Nod fStang;
	protected Nod fDrept;
	protected double x; //x fiecarui nod
	
	public Nod getfStang() {
		return fStang;
	}
	public void setfStang(Nod fStang) {
		this.fStang = fStang;
	}
	public Nod getfDrept() {
		return fDrept;
	}
	public void setfDrept(Nod fDrept) {
		this.fDrept = fDrept;
	}
	public double getX() {
		return x;
	}
	public void setX(double x) {
		this.x = x;
		if(fStang !=null)
			this.fStang.x=x;
		if(fDrept !=null)
			this.fDrept.x=x;
	}
	
	public void acceptVisitor(Visitor v){
		v.visit(this);
	}
}
